home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 10
/
AACD 10.iso
/
AACD
/
Online
/
SpeakFreely
/
src
/
adpcm
/
rawcaudio.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-05-18
|
485b
|
30 lines
/* testc - Test adpcm coder */
#include "adpcm.h"
#include <stdio.h>
struct adpcm_state state;
#define NSAMPLES 1000
char abuf[NSAMPLES/2];
short sbuf[NSAMPLES];
main() {
int n;
while(1) {
n = read(0, sbuf, NSAMPLES*2);
if ( n < 0 ) {
perror("input file");
exit(1);
}
if ( n == 0 ) break;
adpcm_coder(sbuf, abuf, n/2, &state);
write(1, abuf, n/4);
}
fprintf(stderr, "Final valprev=%d, index=%d\n",
state.valprev, state.index);
exit(0);
}